<template>
  <div class="container with-nav-padding">
    <div class="user-info" :style="{background: mainColor}">
      <div class="top-icon">
        <div class="icon-dot"></div>
        <img src="@/assets/个人中心-assets/icon.png" alt="" />
      </div>
      <div class="user">
        <div class="avatar"></div>
        <div class="info">
          <div class="username">
            <span class="name">昵称昵称</span>
            <span class="vip-status">普通会员</span>
          </div>
          <div class="other-info">
            <!-- <span class="expire">有效期至2019.12.31</span> -->
            <span class="invite">邀请码：{{ inviteCode }}</span>
            <span class="copy">复制</span>
          </div>
        </div>
      </div>
    </div>
    <div class="profit_option">
      <div class="total_option">
        <div>3000.00</div>
        <p>总收益(元)</p>
      </div>
      <ul>
        <li class="item_option">
          <p class="item_num">3000.00</p>
          <p class="item_name">待入账</p>
        </li>
        <li class="item_option">
          <p class="item_num">3000.00</p>
          <p class="item_name">余额</p>
        </li>
        <li class="item_option">
          <p class="item_num">3000.00</p>
          <p class="item_name">已提现</p>
        </li>
        <div class="clear"></div>
      </ul>
    </div>
    <div class="profit_type">
      <ul>
        <li class="type-item">
          <img src="@/assets/vip-assets/1推荐人.png" alt="" />
          <p class="type_num">3000.00</p>
          <p class="type_name">推荐奖励(元)</p>
        </li>
        <li class="type-item">
          <img src="@/assets/vip-assets/2购物.png" alt="" />
          <p class="type_num">3000.00</p>
          <p class="type_name">购物收益(元)</p>
        </li>
        <li class="type-item">
          <img src="@/assets/vip-assets/3团队.png" alt="" />
          <p class="type_num">3000</p>
          <p class="type_name">我的团队(个)</p>
        </li>
      </ul>
      <div class="clear"></div>
    </div>
    <a class="invite_img"
      ><img class="ad" src="@/assets/vip-assets/gg.png" alt=""
    /></a>
    <div class="profit_app">
      <ul>
        <li class="app-item">
          <img src="@/assets/vip-assets/icon1.png" alt="" />
          <p class="app_name">我的导师</p>
        </li>
        <li class="app-item">
          <img src="@/assets/vip-assets/icon2.png" alt="" />
          <p class="app_name">商学院</p>
        </li>
        <li class="app-item">
          <img src="@/assets/vip-assets/icon3.png" alt="" />
          <p class="app_name">VIP权益</p>
        </li>
        <div class="clear"></div>
      </ul>
    </div>
    <div class="item-panel">
      <div class="btn-bar">
        <div class="btn_l">
          <img src="@/assets/vip-assets/3团队.png" alt="" />
          <span>999元礼包</span>
        </div>
        <div class="btn_r">
          <img src="@/assets/vip-assets/3团队.png" alt="" />
          <span>9999元礼包</span>
        </div>
      </div>
      <div class="banner-img"></div>
    </div>
    <div class="item-panel_small-img">
      <item-small-img></item-small-img>
    </div>
  </div>
</template>

<script>
import itemSmallImg from "@/components/item-small-img.vue";
import { mapState } from 'vuex'
export default {
  data() {
    return {
      inviteCode: 1254
    };
  },
  components: {
    itemSmallImg
  },
  computed: {
    ...mapState({
      mainColor: state => state.app.mainColor
    })
  },
};
</script>

<style lang="less" scoped>
.container {
  .clear {
    clear: both;
  }

  .user-info {
    color: #f5f5f5;
    height: 6rem;
    background-color: rgb(6, 120, 255);
    padding: 0.9rem 3.2% 0.6rem;
    overflow: hidden;
    position: relative;

    .top-icon {
      width: 1.5rem;
      text-align: center;
      height: 1.24rem;
      line-height: 1.24rem;
      right: 3.2%;
      top: 0.8rem;
      position: absolute;

      .icon-dot {
        position: absolute;
        right: 0;
        top: 0;
        width: 0.28rem;
        height: 0.28rem;
        border-radius: 50%;
        background-color: red;
      }

      img {
        margin-top: 0.3rem;
        width: 55%;
      }
    }

    .user {
      display: flex;

      .avatar {
        height: 2rem;
        width: 2rem;
        border-radius: 50%;
        background: #dfdfdf;
      }

      .info {
        margin-left: 0.52rem;
        width: calc(100% - 3rem);

        .username {
          .name {
            font-size: 0.64rem;
            margin-right: 0.8rem;
            font-weight: bold;
          }

          .vip-status {
            font-size: 0.48rem;
            background: rgba(255, 255, 255, 0.2);
            display: inline-block;
            height: 0.76rem;
            border-radius: 0.38rem;
            line-height: 0.76rem;
            padding: 0 0.3rem;
          }
        }

        .other-info {
          margin-top: 0.4rem;
          font-size: 0.52rem;

          .expire {
            margin-right: 6%;
          }

          .copy {
            text-decoration: underline;
            margin-left: 3.33%;
          }
        }
      }
    }
  }

  .profit_option {
    position: relative;
    top: -2rem;
    left: calc(50% - 7.02rem);
    width: 14.04rem;
    background-color: #fff;
    border-radius: 0.32rem;
    padding: 1rem;

    .total_option {
      width: 100%;
      text-align: center;
      margin-bottom: 0.8rem;
    }

    .total_option div {
      font-weight: bold;
      color: #444444;
      font-size: 0.96rem;
    }

    .total_option p {
      color: #999999;
      font-size: 0.56rem;
    }

    .item_option {
      width: 33.3%;
      float: left;
      text-align: center;

      .item_num {
        color: #444444;
        font-weight: bold;
        font-size: 0.56rem;
      }

      .item_name {
        color: #999999;
        font-size: 0.56rem;
        margin-top: -0.1rem;
      }
    }
  }

  .profit_type {
    width: 100%;
    background: #fff;
    padding: 1rem 1rem 1.5rem;
    margin-top: -1.2rem;

    .type-item {
      width: 33.3%;
      float: left;
      text-align: center;
      height: 1.46rem;
      border-right: 2px solid #e9e9e9;

      img {
        width: 1.06rem;
        height: 1.06rem;
        margin: -0.5rem 0 0.2rem;
      }

      .type_num {
        color: #333333;
        font-size: 0.72rem;
        margin-bottom: 0.2rem;
      }

      .type_name {
        color: #999999;
        font-size: 0.52rem;
        margin-top: -0.1rem;
      }
    }

    .type-item:last-child {
      border: none;
    }
  }

  .profit_app {
    width: 100%;
    background: #fff;
    padding: 0.3rem 0 0.3rem;
    margin-top: 0.5rem;

    .app-item {
      width: 33.3%;
      float: left;
      text-align: center;
      padding-bottom: 0.5rem;

      img {
        width: 1.96rem;
        height: 1.96rem;
        margin: 0.5rem 0 0.2rem;
      }

      .app_name {
        color: #444444;
        font-size: 0.64rem;
      }
    }
  }

  .invite_img {
    width: 100%;
    display: inline-block;
    text-align: center;
  }

  .ad {
    width: 90%;
  }

  .item-panel {
    background: #fff;
    margin-top: 0.48rem;

    .btn-bar {
      width: 100%;
      height: 2rem;
      padding: 0 0;
      display: flex;
      justify-content: space-between;
      line-height: 2rem;

      .btn_l {
        width: 50%;
        background-color: #fd555e;
        color: #ffffff;
        text-align: center;
        font-size: 0.72rem;

        img {
          height: 0.76rem;
          width: 0.76rem;
          margin-right: 0.3rem;
        }
      }

      .btn_r {
        width: 50%;
        background-color: #f7d5d7;
        color: #444444;
        text-align: center;
        font-size: 0.72rem;

        img {
          height: 0.76rem;
          width: 0.76rem;
          margin-right: 0.3rem;
        }
      }
    }
  }
}
</style>
